﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Gqq.CSharpindepth2.Common
{
   public static class TestCommon
   {
       public static void Test()
       {
           IDrawing drawing = new CircleDrawing();
           var shapes = drawing.Shapes;
//           var type = shapes.GetType();
           if (shapes != null)
           {
               Console.WriteLine(shapes.GetType());
               foreach (var shape in shapes)
               {
                   Console.WriteLine(shape.DisplayShape());
               }
           }
           TestType<Circle>();
           TestType<int>();
       }

       /// <summary>
       /// 通过反射获取传入类型的泛型方法。
       /// 通过这个方法，可以更好的使用反射，了解传入类型的具体细节。
       /// </summary>
       /// <typeparam name="T"></typeparam>
       public static void TestType<T>()
       {
           Console.WriteLine(typeof (T));
           Console.WriteLine(typeof (List<T>));
       }
   }


}
